package com.star.controller.admin;

import com.star.dto.CommentsPageQueryDTO;
import com.star.result.PageResult;
import com.star.result.Result;
import com.star.service.CommentsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController("adminCommentsController")
@RequestMapping("/admin/comments")
@Slf4j
@Api(tags ="管理员端订单评论相关接口")
public class CommentsController {
    @Autowired
    private CommentsService commentsService;

    /**
     * 评论列表分页查询
     * @return
     */
    @PostMapping("/pageQuery")
    @ApiOperation("评论列表分页查询")
    public Result<PageResult> pageQuery(@RequestBody CommentsPageQueryDTO commentsPageQueryDTO){
        log.info("评论列表分页查询{}", commentsPageQueryDTO);
        PageResult pageResult = commentsService.pageQuery(commentsPageQueryDTO);
        return Result.success(pageResult);
    }
}
